<%@page import="com.sbdcpn.utils.db.BaseDAO,
				java.util.List,
				java.util.Map"%>
<%
	BaseDAO _dao = BaseDAO.getInstance();

	String strSQL = "Select to_char(view_jl_mb_account.acc_date ,'yyyy-mm') as month From view_jl_mb_account " + 
					"Where view_jl_mb_account.acc_date Is Not Null " + 
					"Group By to_char(view_jl_mb_account.acc_date ,'yyyy-mm')";
	List lsMonth = _dao.query(strSQL);
%>
<script language="javascript">
<!--
/**
*	
*/
function f_search_query() {
	var where_sql = "to_char(view_jl_mb_account.acc_date ,'yyyy-mm') = ?";
	var where_value = document.all("selMonth").value;
	var where_type = "string";

	//alert("pageType = " + f_getPageType());

	document.all("where_sql").value = where_sql;
	document.all("where_value").value = where_value;
	document.all("where_type").value = where_type;
	document.all("extend_param").value = where_value;

	f_reloadPage();
}

/**
*/
function f_setGrid() {
	var pageType = f_getPageType();
	if (pageType == "grid") {
		var extend_param = document.all("extend_param").value;

		if (extend_param != "")
			document.all("selMonth").value = extend_param;
	}
}
//-->
</script>
<table>
<tr>
	<td>
	<label><eam:message key="stock.report.totalmonth" />:</label>
	<select name="selMonth">
	<%
	Map mpMonth = null;
	for (int i = 0 ,n = lsMonth.size() ;i < n ;i++ ) {
		mpMonth = (Map)lsMonth.get(i);
	%>
	<option value="<%=(String)mpMonth.get("month")%>">
	<%=(String)mpMonth.get("month")%>
	</option>
	<%
	}
	%>
	</select>
	<input type="button" name="btnSearch" id="btnSearch" value="<eam:message key="event.button.filter" />" onClick="f_search_query();">
	</td>
</tr>
</table>